
import 'package:secend_flutter/bean/home_common_model_bean.dart';
import 'package:secend_flutter/bean/home_config_model_bean.dart';
import 'package:secend_flutter/bean/home_sales_box_model_bean.dart';
import 'home_grid_nav_model_bean.dart';


// SalesBoxModel salesBox
class HomeBean {
  final Config config;
  final List<CommonBean> bannerList;
  final List<CommonBean> localNavList;
  final List<CommonBean> subNavList;
  final GridNavBean gridNav;
  final SalesBoxBean salesBox;

  HomeBean(
      {required this.config,
        required this.bannerList,
        required this.localNavList,
        required this.subNavList,
        required this.gridNav,
        required this.salesBox});

  factory HomeBean.fromJson(Map<String, dynamic> json) {

    var bannerListJson = json['bannerList'] as List;
    List<CommonBean> bannerList =
    bannerListJson.map((i) => CommonBean.fromJson(i)).toList();

    var localNavListJson = json['localNavList'] as List;
    List<CommonBean> localNavList =
    localNavListJson.map((i) => CommonBean.fromJson(i)).toList();

    var subNavListJson = json['subNavList'] as List;
    List<CommonBean> subNavList =
    subNavListJson.map((i) => CommonBean.fromJson(i)).toList();

    return HomeBean(
      localNavList: localNavList,
      bannerList: bannerList,
      subNavList: subNavList,
      config: Config.fromJson(json['config']),
      gridNav: GridNavBean.fromJson(json['gridNav']),
      salesBox: SalesBoxBean.fromJson(json['salesBox']),
    );
  }
}

